04. OpenAI Gym

OpenAI Gym

Gym is a toolkit created by OpenAI for the purpose of comparing Reinforcement Learning algorithms. It is not a collection of the many algorithms and agents, but rather a framework for the environments that those agents act within. Gym is open source and includes a wide variety of environment types including:

Check out this blog post to read more about how OpenAI Gym is used to accelerate reinforcement learning (RL) research.

(Optional) Installation Instructions

You are not required to install OpenAI Gym on your computer, and you will have the option to do all of your coding implementations within the classroom. You can learn more about OpenAI Gym by perusing the GitHub repository.

If you'd like to install OpenAI Gym on your machine, you are encouraged to perform a minimal install. Start by adding libav, which provides cross-platform tools and libraries to convert, manipulate and stream a wide range of multimedia formats and protocols:

sudo apt-get install libav-tools

Then install gym:

git clone https://github.com/openai/gym.git
cd gym
pip install -e .

Once you have installed OpenAI Gym, obtain the code for the classic control tasks (such as 'CartPole-v0'):

pip install -e '.[classic_control]'

Finally, check your installation by running the simple random agent provided in the examples directory.

cd examples/agents
python random_agent.py

(These instructions are derived from the README in the GitHub repository.)

Quiz 5: OpenAI Gym

Which of the following are true about OpenAI Gym? Check all that are true.

SOLUTION:
  • It includes dozens of different environments for testing reinforcement agents.
  • It was designed as a toolkit for developing and comparing reinforcement algorithms.
  • It was developed to address the lack of benchmarks and standardization in RL research.